{% extends "RegardInstituteBundle::layout.html.twig" %}

{% block title %}{{ categoryName }} Marseille 4e (Chartreux){% endblock %}

{% block content %}

<div id="TARIFF">
	<div id="category_title">
		{{ categoryName|upper }}
	</div>
	
    <div>
		<a href="{{ path('regard_institute_list_categories') }}">
			< Retour &agrave; la liste des soins
		</a>
	</div>
	
	{% if is_granted('ROLE_ADMIN') %}
	<br />
		<div>
			<a href="{{ path('regard_institute_cares_add', {'categoryId':categoryId}) }}">Ajouter un soin</a>
		</div>
	{% endif %}

	<div id="notice">
		{% for flashMessage in app.session.flashbag.get('notice') %}
			{{ flashMessage }}
		{% endfor %}
	</div>
	<br />
		
	{% if isTariffType %}
	
		<table>
			{% for tariff in tariffList %}
				<tr>
					<td class="name">
						{{ tariff.name|upper }}
						<br />
						<span class="desc_little">{{ tariff.description|upper }}</span>
						{% if is_granted('ROLE_ADMIN') %}
							<span>
								&nbsp;(<a href="{{ path('regard_institute_cares_edit', {'tariffId': tariff.id}) }}">Mod</a>
							</span>
							<span>
								&nbsp;&#124;&nbsp;
							</span>
							<span>
								<a href="{{ path('regard_institute_cares_delete', {'tariffId': tariff.id}) }}">Suppr</a>)
							</span>
						{% endif %}
					</td>
					<td class="price"><div>{{tariff.price}}&euro;</div></td>
				</tr>
			{% endfor %}
		</table>
	
	{% else %}
	
		{% for tariff in tariffList %}
			<div class="div_product">
				<div class="div_image">
					<img src="{{ asset('img/content/'~tariff.picture) }}" title="{{ tariff.name }}" alt="{{ tariff.name }}"/>
					{# <img src="{{ asset('img/produits/'~product.picture) }}" title="{{ product.name }}" alt="{{ product.name }}"/> #}
				</div>
				<div class="div_product_text">
					<div class="div_title">
						{{tariff.name}}
						{% if is_granted('ROLE_ADMIN') %}
							<span>
								&nbsp;<a href="{{ path('regard_institute_cares_edit', {'tariffId': tariff.id}) }}">Modifier</a>
							</span>
							<span>
								&nbsp;&#124;&nbsp;
							</span>
							<span>
								<a href="{{ path('regard_institute_cares_delete', {'tariffId': tariff.id}) }}">Supprimer</a>
							</span>
						{% endif %}
						<div class="div_price" style="float: right;">
							{{ tariff.price }}&euro;
						</div>
					</div>
					<div class="div_desciption">
						<p>
							{{ tariff.description|nl2br }}
						</p>
					</div>
					<div class="news_link">
						<a href="{{ path('regard_contact_index', 
											{'type': 'Institut', 'messageContent': 'J ai une question sur le soin '~tariff.name~''}) }}">
							&nbsp;> Poser une question sur ce produit
						</a>
					</div>
				</div>
			</div>
		{% endfor %}
	
	{% endif %}
	
</div>

{% endblock %}
